/*
 *  Copyright 2019-2020 Zheng Jie
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.fzhucc.modules.SendPro.controller;

import com.fzhucc.annotation.Log;
import com.fzhucc.annotation.rest.AnonymousGetMapping;
import com.fzhucc.annotation.rest.AnonymousPostMapping;
import com.fzhucc.modules.SendPro.dto.SendProDto;
import com.fzhucc.modules.SendPro.service.SendProService;
import com.fzhucc.modules.pms.domain.dto.ProjectScoreDistributionDto;
import com.fzhucc.modules.security.domain.dto.AuthDto;
import com.fzhucc.modules.signInRecord.service.SignInRecordService;
import com.fzhucc.modules.technical.domain.dto.TechnicalAddDto;
import com.fzhucc.modules.technical.domain.dto.TechnicalDto;
import com.fzhucc.modules.technical.domain.dto.TechnicalEditDto;
import com.fzhucc.modules.technical.domain.dto.TechnicalQueryCriteria;
import com.fzhucc.modules.technical.service.TechnicalService;
import com.fzhucc.modules.thinktank.domain.dto.AllBindDto;
import com.fzhucc.modules.thinktank.domain.dto.AllBindDto2;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author yyg
 * @date 2023-08-22
 */
@RestController
@RequiredArgsConstructor
@Api(tags = "发送数据至全总:管理")
@RequestMapping("/api/sendPro")
public class SendProController {

    private final SendProService sendProService;

    @ApiOperation("发送项目数据至全总")
    @Log("发送项目数据至全总")
    @AnonymousPostMapping(value = "/topic/pro/push")
    public ResponseEntity<Object> pushPro(@RequestBody SendProDto sendProDto) {
        return new ResponseEntity<>(sendProService.pushPro(sendProDto), HttpStatus.OK);
    }

    @ApiOperation("根据id删除全总项目数据")
    @Log("根据id删除全总项目数据")
    @AnonymousGetMapping(value = "/deleteById")
    public ResponseEntity<Object> deleteById(@RequestParam String pmsId) {
        return new ResponseEntity<>(sendProService.deleteById(pmsId), HttpStatus.OK);
    }


}